# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1RevenueShareRange do
  @moduledoc """
  API call volume range and the percentage of revenue to share with the developer when the total number of API calls is within the range.

  ## Attributes

  *   `end` (*type:* `String.t`, *default:* `nil`) - Ending value of the range. Set to 0 or `null` for the last range of values.
  *   `sharePercentage` (*type:* `float()`, *default:* `nil`) - Percentage of the revenue to be shared with the developer. For example, to share 21 percent of the total revenue with the developer, set this value to 21. Specify a decimal number with a maximum of two digits following the decimal point.
  *   `start` (*type:* `String.t`, *default:* `nil`) - Starting value of the range. Set to 0 or `null` for the initial range of values.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :end => String.t() | nil,
          :sharePercentage => float() | nil,
          :start => String.t() | nil
        }

  field(:end)
  field(:sharePercentage)
  field(:start)
end

defimpl Poison.Decoder, for: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1RevenueShareRange do
  def decode(value, options) do
    GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1RevenueShareRange.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1RevenueShareRange do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
